package com.gujia.designpattern.adapter;

import com.gujia.designpattern.adapter.extend.TwoPlugAdapterExtends;
import com.gujia.designpattern.adapter.interf.ThreePlug;
import com.gujia.designpattern.adapter.interf.TwoPlugAdapter;

public class NoteBook {

    private ThreePlug plug;

    public NoteBook(ThreePlug plug) {
        this.plug = plug;
    }

    public void charge(){
        plug.powerWhreeThree();
    }
    public static void main(String[] args) {
        GBTwoPlug twoPlug = new GBTwoPlug();
        ThreePlug plug = new TwoPlugAdapter(twoPlug);
        NoteBook noteBook = new NoteBook(plug);
        noteBook.charge();

        plug = new TwoPlugAdapterExtends();


        noteBook = new NoteBook(plug);
        noteBook.charge();
    }

}
